﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class comments : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //String id = Request.QueryString["id"];
        //DatabaseProcess dp = new DatabaseProcess();
        //String query = "SELECT title,details,image_,post_date FROM news WHERE news_id ='" + id + "'";
        //DataTable dt = dp.ConnectDataBaseReturnDT(query);

        //khai bao
        Panel panel = new Panel();
        panel.CssClass = "comment_invidual";

        Panel panel_image = new Panel();
        panel_image.CssClass = "comment_image";

        Panel panel_wrap = new Panel();
        panel_wrap.CssClass = "comment_wrap";

        Panel panel_comment = new Panel();
        panel_comment.CssClass = "commment_comment";

        Panel panel_date = new Panel();
        panel_date.CssClass = "comment_date";

        ImageButton image = new ImageButton();
        Label comment = new Label();
        Label date = new Label();

        //gan gia tri
        comment.Text = "test comment";
        date.Text = "test date";
        image.ImageUrl = "~/Images/seconde_article.jpg";
        image.Width = 60;
        image.Height = 60;
        
        //

        panel_image.Controls.Add(image);
        panel_comment.Controls.Add(comment);
        panel_date.Controls.Add(date);

        panel_wrap.Controls.Add(panel_comment);
        panel_wrap.Controls.Add(panel_date);

        panel.Controls.Add(panel_image);
        panel.Controls.Add(panel_wrap);


        //them cac comment
        comment_content.Controls.Add(panel);
    }
}